Rail3D*


 

DB Tab


Spotlog has a DB Tab which allows you to query and update the database using SQL.  The DB tab is not normally visible, you can enable the DB tab in the app's settings.

See also spotlogfields

Enabling the DB Tab

To enable the DB tab, go into the Apps settings

The DB Tab will be added the next time the App is started.

Using the DB Tab 

To use the tab, enter an SQL command in the input box and click "Execute".

If the command entered is a SELECT statement, the results of the command will be displayed on the page below the input.

Points to note

  • Due to limitations of screen size, only five output columns can be displayed (in portrait  mode).  If your select statement has more output columns, ony the first five will be displayed.
  • In landscape mode, up to  10 columns can be displayed
  • If you enter a non-SELECT command, eg UPDATE, the previous SELECT command will be executed again, after the UPDATE (etc) and the new results displayed.  (see below)
  • Your SELECT command must include an _id column (see spotlogfields

 

Example

  • Selecting all the records in the log:

    SELECT * FROM record WHERE loco IS NOT NULL




  • Show all the records in the NotePad:

    SELECT * FROM record WHERE loco IS NULL

  • Select records with a particular note:

    SELECT * FROM record WHERE note LIKE 'test'



  • Change the note field:

    UPDATE record SET note='My new note' WHERE note LIKE 'test'


If you have questions about the DB tab, or how to write the SQL commands, please ask in the SpotLog Forum


 

Manual 

 

 


MRG 15/04/2016 07:30:45